<#import "/spring.ftl" as spring />

<#include "/tags/userNotification.ftl">
<#include "/tags/famousQuote.ftl">
<#include "/tags/userCompleteness.ftl">
<#include "/tags/userIntroTag.ftl">
<#include "/tags/friendList.ftl">
<#include "/tags/friendHintTag.ftl">
﻿<#include "/tags/goalProcessTag.ftl">
<#include "/tags/goalEntryTag.ftl">
<#include "/tags/goalCloudTag.ftl">
<#include "/tags/updatedSinceTag.ftl">
<#include "/tags/entryAvatar.ftl">
<#include "/tags/topGoalsTag.ftl">
<#include "/tags/commonGoalsTag.ftl">
<#include "/tags/confirmBox.ftl">
<#include "/tags/editEntryTag.ftl">
<#include "/tags/commentTag.ftl">
<#include "/tags/commentBoxTag.ftl">
<#include "/tags/userEntryTag.ftl">
<#include "/tags/userHowIDoneTag.ftl">
<#include "/tags/activitiesTag.ftl">
<#include "/tags/shouldDoGoalTag.ftl">
<#include "/tags/mustDoGoalWidget.ftl">
<#include "/tags/tabTag.ftl">

<head>	     	
	<link rel="stylesheet" type="text/css" href="${rc.contextPath}/styles/style_dev.css">
	<link rel="stylesheet" type="text/css" href="${rc.contextPath}/scripts/cleditor/jquery.cleditor.css">
	<link rel="stylesheet" type="text/css" href="${rc.contextPath}/styles/ui-lightness/jquery-ui-1.8.5.custom.css">
	<link type="text/css" rel="stylesheet" href="${rc.contextPath}/styles/tools/jquery.autocomplete.css">
	<link rel="stylesheet" type="text/css" href="${rc.contextPath}/styles/jquery.alertbox.css">
	
	<script type="text/javascript" src="${rc.contextPath}/scripts/cleditor/jquery.cleditor.min.js"></script>     
	<script type="text/javascript" src="${rc.contextPath}/scripts/jquery.ui.mouse.min.js"></script>
	<script type="text/javascript" src="${rc.contextPath}/scripts/jquery.ui.position.min.js"></script>
	<script type="text/javascript" src="${rc.contextPath}/scripts/jquery.ui.slider.min.js"></script>
	<script type="text/javascript" src="${rc.contextPath}/scripts/jquery.autocomplete.js"></script>
	
	<script type="text/javascript" src="${rc.contextPath}/scripts/common.entry.paging.js"></script>
	<script type="text/javascript" src="${rc.contextPath}/scripts/jquery.nonajax.js"></script>
	<script type="text/javascript" src="${rc.contextPath}/scripts/page.userDashboard.js"></script>
	<script type="text/javascript" src="${rc.contextPath}/scripts/goalProcess.js"></script>
	<script type="text/javascript" src="${rc.contextPath}/scripts/editEntry.js"></script>
	<script type="text/javascript" src="${rc.contextPath}/scripts/common.goalUtils.js"></script>	
	<script type="text/javascript" src="${rc.contextPath}/scripts/page.shouldDoGoal.js"></script>
	<script type="text/javascript" src="${rc.contextPath}/scripts/widget.js"></script>
	<script type="text/javascript" src="${rc.contextPath}/dwr/interface/GoalEntryManager.js"></script>
	<script type="text/javascript" src="${rc.contextPath}/scripts/jquery.easing.1.3.js"></script>
	<script type="text/javascript" src="${rc.contextPath}/scripts/jquery.alertbox.js"></script>
	<title>${data.userInSession}'s dashboard</title>
</head>

<div style="display:none;">
	<div id="sliderPopup" class="userSlider">
		<h1>Bạn đã hoàn thành được bao nhiêu % mục tiêu này?</h1>
		<p>Việc cập nhật số % hoàn thành của một mục tiêu giúp bạn kiểm soát được quá trình thực hiện mục tiêu của mình, hãy cập nhật nó ít nhất 1 tuần 1 lần.</p>
		<div class="slider">
			<div id="slider" rel="#sliderValue a"></div>
			<div id="sliderValue">
				<a>0%</a>
			</div>
			<div class="w4"></div>
			<div id="closeSlider">
				<a href="#" class="icon_1 btnUploadAvatar" style="margin-left:200px">Cập nhật</a>
			</div>
		</div>
	</div>
</div>

<@userNotification />  
<div class="w3"></div>

<div id="infomation">           
    <!-- user mustDoGoalWidget -->		
    <#if data.mustDoGoal??>
    	<@mustDoGoalWidget data.mustDoGoal.id data.mustDoGoal.title data.mustDoGoal.userCount/>
    </#if>	
	<div id="left">
        <@tab viewer=data.userInSession pageOwner=data.userInSession page="DASHBOARD" />
        <div class="clearthis"></div>
        <div class="dashboardBlueBox">
        	<div class="dbTitle">
            	<b><@spring.message "page.dashboard.whatIsYourGoal" /></b><label>VUI LÒNG SỬ DỤNG TIẾNG VIỆT CÓ DẤU.</label>
            </div>
            <@spring.bind "data" />
            <form name="data" action="/addNewSMARTGoal.html" method="POST">
            <div class="dbAddGoal">            	
            	<span class="addGoalForm bgPos">            		
            		<@spring.formInput path="data.newGoalTitle" attributes="autocomplete='off' class='ac_input' rel='${data.settings.allowAddGoal?string(\'allow\',\'deny\')}' maxlength='255'"/>            	
            	</span>
                <a id="add_goal" title="Thêm mục tiêu vào danh sách." href="#"></a>
            </div>
            </form>
            <p class="goalExample">Ví dụ: <a href="#">học guitar</a>, <a href="#">học giỏi tiếng anh</a>, <a href="#">du học</a>...</p>
        </div>
    	<!--
    	<div class="question">
        	<h1><@spring.message "page.dashboard.whatIsYourGoal" /> </h1>
        	<h2> <@spring.message "page.dashboard.goalHint" /></h2>
      	</div>
      	<div id="igoal_search">
      		<div id="block_igoal_search">
        		<input type="text" rel="${data.settings.allowAddGoal?string('allow','deny')}" id="new_goal_value" maxlength="255"/>
        		<input type="button" value="search" id="add_goal" />
        	</div>
      	</div>
      	-->
      	<div class="clear"></div>
      	<div id="addGoalResult"></div>
		<@shouldDoGoals />
		<!--
      	<@topGoals />
      	-->
     	<@goalprocess />      	
      	<div id="entry_container" class="entryContainer">
			<#if (data.recentEntries?? && data.recentEntries?size>0)>
				<div class="archtitle"><@spring.message "page.dashboard.recentEntry"/></div>
				<#list data.recentEntries as entry>
					<#if (entry.entryType==1)>		
						<!-- entry view -->
						<div id="entry_holder_${entry.id}" class="entryPost">	      
					    	<@entryView entryId=entry.id goalId=entry.goalId goalTitle=entry.goalTitle 
					      		  youLikeThis=entry.youLikeThis likeCount=entry.likeCount cheerCount=entry.cheerCount 
					      		  commentCount=entry.commentCount body=entry.body title=entry.title imgURL=entry.imgURL 
					      		  entryUpdatedSince=entry.updatedSince createdDate=entry.createdDate createdMonth=entry.createdMonth
					      		  createdYear=entry.createdYear goalCreatedDate=entry.goalCreatedDate ownerName=entry.ownerName
					      		  comments=entry.comments/>		      			      			
				        </div>
						<!-- end of entry view -->
						
						<!-- edit entry holder -->
						<div id="edit_entry_holder_${entry.id}">
						</div>
						<!-- end edit entry holder -->
					<#else>
			    		<div class="archicle entryPost">
							<@userHowIDone title=entry.title goalId=entry.goalId goalTitle=entry.goalTitle 
									   youLikeThis=entry.youLikeThis likeCount=entry.likeCount cheerCount=entry.cheerCount
									   ownerName=entry.ownerName experience=entry.experience 
									   tookType=entry.tookType tookAmount=entry.tookAmount 
									   imgURL=entry.imgURL solution=entry.solution 
									   tip=entry.tip resources=entry.resources entryId=entry.id 
									   cheerCount=entry.cheerCount commentCount=entry.commentCount
									   createdDate=entry.createdDate createdMonth=entry.createdMonth 
									   createdYear=entry.createdYear ownerAvatar=entry.ownerAvatar 
									   goalCreatedDate=entry.goalCreatedDate comments=entry.comments
									   entryUpdatedSince=entry.updatedSince/>
						</div>	
					</#if>
					
					<#assign lastItem=entry/>
				</#list>
				
				<#if lastItem?? && lastItem.ownerId??>
					<div id="next_page_scroll" class="userEntryView;${lastItem.ownerId};" rel="${lastItem.sortedValue}" style="float:left"></div>
					<div id="scroll_loader" style="display: none; width: 100%; float: left; padding-top: 30px;">
						<center>
							<img src="/images/loader.gif"/>
						</center>
					</div>
				</#if>
      		</#if>
		</div>
    </div>
    
    <div id="right">
		<@userCompleteness />
			
		<@topGoals />
		<@userIntro />
        <@friendList username="${data.userInSession}" />
        <@friendHint />
		<div class="clearthis"></div>
		<a href="http://igoal.vn/goal/view/335" >
			<img src="http://igoal.vn/photos/banner_baohanhtreem.png" style="margin-top:10px"/>
		</a>
	</div>
</div>

<!-- edit entry -->
<div id="edit_entry_holder" style="display:none">
	<@editEntry entryId="@entryId@" title="@title@" body="@body@" image="@imgURL@" />
</div>
<!-- end of edit entry -->
